/*
 * This file is part of ddesktop: remote desktop system for iPad 
 *
 * Copyright (C) 2010 Kazuhiro Satoh
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. if not, see <http://www.gnu.org/licenses/>.
 */

#import <UIKit/UIKit.h>
#import "DDClientPort.h"


enum RV_MODE{
	RV_MOUSE_MODE = 0,
	RV_WHEEL_MODE,
	RV_WINDOW_MODE,

	RV_NUM_MODES
};

enum RV_MOUSE_ACTION{
	RV_MOUSE_ACTION_LEFT = 0,
	RV_MOUSE_ACTION_MIDDLE,
	RV_MOUSE_ACTION_RIGHT,
	RV_MOUSE_ACTION_NONE,
	
	RV_NUM_MOISE_ACTIONS
};


enum RV_WINDOW_ACTION{
	RV_WINDOW_ACTION_MOVE = 0,
	RV_WINDOW_ACTION_RESIZE,
	
	RV_NUM_WINDOW_ACTIONS
};



@interface RemoteViewController : UIViewController <UIScrollViewDelegate> {
@private
	DDClientPort* _ddclientPort;
	UIScrollView* _scrollView;
	UIView* _desktopView;
	CALayer* _imageLayer;

	int _drawFrameCt;

	CGPoint _panLocation;
	
	enum RV_MODE _mode;
	enum RV_MOUSE_ACTION _mouseAction;
	enum RV_WINDOW_ACTION _windowAction;
	float _mouseWheelSensitivity;
}

@property (nonatomic) enum RV_MODE mode;
@property (nonatomic) enum RV_MOUSE_ACTION mouseAction;
@property (nonatomic) enum RV_WINDOW_ACTION windowAction;
@property (nonatomic) float mouseWheelSensitivity;


- (bool)startSessionWithPort:(DDClientPort*) port;
- (bool)stopSession;
- (bool)updateView;
- (void)updatePeepFrame;


@end
